/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ucm.Controller;

import ucm.model.UCRegister_Model;
import ucm.*;

public class UCRegister_Controller {
    private String UserName;
    private String PassWord;
    private String RePassWord;

    public UCRegister_Controller() {
    }

    public UCRegister_Controller(String UserName, String PassWord, String RePassWord) {
        this.UserName = UserName;
        this.PassWord = PassWord;
        this.RePassWord = RePassWord;
    }

    public String getPassWord() {
        return PassWord;
    }

    public void setPassWord(String PassWord) {
        this.PassWord = PassWord;
    }

    public String getRePassWord() {
        return RePassWord;
    }

    public void setRePassWord(String RePassWord) {
        this.RePassWord = RePassWord;
    }

    public String getUserName() {
        return UserName;
    }

    public void setUserName(String UserName) {
        this.UserName = UserName;
    }
    
    public boolean run()
    {
        if (UserName.length() == 0 || PassWord.length() == 0 || RePassWord.length() == 0)
        {
            return false;
        }
        if (!PassWord.equals(RePassWord))
        {
            return false;
        }
        UCRegister_Model model = new UCRegister_Model(UserName, PassWord);
        if ( !model.runRegisger() )
        {
            return false;
        }
        return true;
    }
}
